#ifndef HTF_ZLIB_WRAPPER_H
#define HTF_ZLIB_WRAPPER_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>   // for uint8_t
#include <stddef.h>   // for size_t

/**
 * @brief Decompress data using zlib (with support for dynamically expanding the output buffer).
 *
 * @param in        Input compressed data (non-NULL)
 * @param in_size   Input data size (> 0)
 * @param out       Output decompressed data (caller must free() it)
 * @param out_size  Actual size of the output data
 * @return int      0 for success; -1 for initialization failure; -2 for decompression failure
 */
int htf_zlib_decompress(const uint8_t* in, size_t in_size,
                        uint8_t** out, size_t* out_size);

#ifdef __cplusplus
}
#endif

#endif // HTF_ZLIB_WRAPPER_H